package org.zch.common.utils;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;

/**
 * Md5加密，加密规则与客户端一致*/
public class MD5Utils {

    public static String toMD5(String s){
        String mStr = "hua" + s + "lao";
        try {
            mStr = DigestUtils.md5DigestAsHex(mStr.getBytes(StandardCharsets.UTF_8));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mStr;
    }

}
